<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>微信活动参与用户管理</title>
	<meta name="decorator" content="default"/>
</head>
<body>
<div class="main-content">
    <tags:breadcrumb menuId="f13d0765fcfc42b783cb16d8b0ccc876" />
    <div class="page-content">
        <form:form id="searchForm" modelAttribute="weiXinCustomInfo" action="${ctx}/wechat/weiXinCustomInfo/" method="post" class="breadcrumb form-search">
            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
            <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
            <label>名称 ：</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
            &nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
        </form:form>
        <table id="contentTable" class="table table-striped table-bordered table-hover">
            <thead><tr><th>名称</th><th>备注</th><shiro:hasPermission name="wechat:weiXinCustomInfo:edit"><th>操作</th></shiro:hasPermission></tr></thead>
            <tbody>
            <c:forEach items="${page.list}" var="weiXinCustomInfo">
                <tr>
                    <td><a href="${ctx}/wechat/weiXinCustomInfo/form?id=${weiXinCustomInfo.id}">${weiXinCustomInfo.name}</a></td>
                    <td>${weiXinCustomInfo.remarks}</td>
                    <shiro:hasPermission name="wechat:weiXinCustomInfo:edit"><td>
                        <a href="${ctx}/wechat/weiXinCustomInfo/form?id=${weiXinCustomInfo.id}">修改</a>
                        <a href="javascript:;" onclick="deleteMsg('确认要删除该文本消息模板吗？','${ctx}/wechat/weiXinCustomInfo/delete?id=${weiXinCustomInfo.id}',this);">删除</a>
                    </td></shiro:hasPermission>
                </tr>
            </c:forEach>
            </tbody>
        </table>
        <div class="pagination">${page}</div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {

    });

    //删除
    function deleteMsg(msg,href,tr){
        bootbox.confirm(msg,function(obj){
            if(obj) {
                $.post(href,function(data){
                    if(data.success){
                        showNote("success", function () {
                            $(tr).parent().parent().remove();
                        }, data.msg, "center");
                    }else {
                        showNote("error", function () {
                            return false;
                        }, data.msg);
                    }
                });
            }
        });
    }

    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
</script>
</body>
</html>
